package cn.iocoder.yudao.module.bpm.api.task;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmCommonCreateReqDTO;
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmCommonCreateRespDTO;
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 流程公共接口")
public interface BpmCommonApi {

  String PREFIX = ApiConstants.PREFIX + "/common";

  @PostMapping(PREFIX + "/createFlow")
  @Operation(summary = "创建流程")
  @Parameter(name = "vo", description = "创建流程对象", required = true)
  public CommonResult<BpmCommonCreateRespDTO> createFlow(@RequestBody BpmCommonCreateReqDTO vo);

  @PostMapping(PREFIX + "/createAndSubmitFlow")
  @Operation(summary = "创建并提交流程")
  @Parameter(name = "vo", description = "创建流程对象", required = true)
  public CommonResult<BpmCommonCreateRespDTO> createAndSubmitFlow(@RequestBody BpmCommonCreateReqDTO vo);


  @PostMapping(PREFIX + "/submitFlow")
  @Operation(summary = "提交流程")
  @Parameter(name = "vo", description = "创建流程对象", required = true)
  public CommonResult<BpmCommonCreateRespDTO> submitFlow(@RequestBody BpmCommonCreateReqDTO vo);

}
